package com.smh.a03converStreamDemo1;

import java.io.*;
import java.nio.charset.Charset;

public class ConvertStreamDemo1 {
    public static void main(String[] args) throws IOException {
        //转化流
        //jdk11被淘汰了,(不要求掌握)

        InputStreamReader isr = new InputStreamReader(new FileInputStream("day27-code\\file\\demo1\\a.txt"), "GBK");

        int b;
        while ((b = isr.read()) != -1) {
            System.out.print((char) b);
        }
        isr.close();
        System.out.println();

        //z掌握
        FileReader fr = new FileReader("day27-code\\file\\demo1\\a.txt", Charset.forName("UTF-8"));
        while ((b = fr.read()) != -1) {
            System.out.print((char) b);
        }
        fr.close();

    }
}
